<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script>
    function page(n,s){
        $("#pageNo").val(n);
        $("#pageSize").val(s);
        $("#billInfo").submit();
        return false;
    }
    function denomSignPrint() {
        var visitId = $("#visitId").val();
        var patientId = $("#patientId").val();
        var name = $("#name").val();
        printPdf('${ctx}/nurse/searchBillPrint', 'visitId='+visitId+'&patientId='+patientId+"&name="+name);
    }
</script>
    <!-- content wrapper -->
    <div class="content-wrap">
        <div class="wrapper" style="bottom: 50px;">
            <ul class="nav nav-tabs">
                <li><a href="#" onclick="loadDiv('mainCenterDiv','${ctx}/nurse/index')">床位列表</a></li>
                <li class="active">
                    <a href="#"   >计价单</a>
                </li>
            </ul>
            <section class="panel panel-default">
                <div class="panel-body">
                    <div class="table-responsive no-border">
                        <div class="datatable-top">
                            <div class="pull-left">
                                <form class="form-horizontal"  id="billInfo" onsubmit="return loadDivForm('mainCenterDiv','billInfo','${ctx}/nurse/denomSign');" method="post">
                                    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                                    <input type="hidden" value="${inpBillDetail.visitId}" name="visitId" id="visitId">
                                    <input type="hidden" value="${inpBillDetail.patientId}" name="patientId" id="patientId">
                                    <div class="col-lg-3">
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label">床标号：</label>
                                            <div class="col-sm-7">
                                                <input type="text" name="bedRec.bedLabel" class="form-control" value="${patVisit.bedNo}" readonly>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label">预交金：</label>
                                            <div class="col-sm-7">
                                                <input type="text" name="prepayments" class="form-control" value="${patVisit.prepayments}" readonly>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label">查询时间：</label>
                                            <div class="col-sm-7">
                                                <input type="text" name="startTime" class="form-control Wdate" value="${inpBillDetail.startTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-lg-3">
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label">姓名：</label>
                                            <div class="col-sm-7">
                                                <input type="text" name="name" id="name" class="form-control" value="${patVisit.patVisitIndex.name}" readonly>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label">费别：</label>
                                            <div class="col-sm-7">
                                                <input type="text" name="chargeType" class="form-control"  value="${fns:getDictLabel(patVisit.patVisitIndex.chargeType, 'CHARGE_TYPE_DICT', '')}" readonly>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label">至：</label>
                                            <div class="col-sm-7">
                                                <input type="text" name="endTime" class="form-control Wdate" value="${inpBillDetail.endTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-lg-3">
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label">性别：</label>
                                            <div class="col-sm-7">
                                                <input type="text" name="sex" class="form-control"  value="${fns:getDictLabel(patVisit.patVisitIndex.sex, 'SEX_DICT', '')}" readonly>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label">诊断：</label>
                                            <div class="col-sm-7">
                                                <input type="text" name="diagnosis" class="form-control" value="${patVisit.diagnosis}" readonly>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label"></label>
                                            <div class="col-sm-7">
                                                <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
                                                <input class="btn btn-primary" onclick="denomSignPrint()" type="button" value="打印"/>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-lg-3">
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label">年龄：</label>
                                            <div class="col-sm-7">
                                                <input type="text" name="age" class="form-control" value="${patVisit.patVisitIndex.age}" readonly>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label">经治医师：</label>
                                            <div class="col-sm-7">
                                                <input type="text" name="doctorInCharge" class="form-control" value="${patVisit.doctorInCharge}" readonly>
                                            </div>
                                        </div>

                                    </div>
                                </form>
                            </div>
                        </div>


                        <table id="contentTable" class="table table-bordered mg-t datatable">
                            <thead>
                            <tr>
                                <th>类别</th>
                                <th>项目名称</th>
                                <th>规格</th>
                                <th>数量</th>
                                <th>单位</th>
                                <th>计价费用</th>
                                <th>应收费用</th>
                                <th>执行科室</th>
                                <th>子库房</th>
                                <th>录入员</th>
                                <th>日期</th>
                            </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${page.list}" var="details">
                            <tr>
                                <td>${details.itemClass}</td>
                                <td>${details.itemName}</td>
                                <td>${details.itemSpec}</td>
                                <td>${details.amount}</td>
                                <td>${details.units}</td>
                                <td>${details.itemPrice}</td>
                                <td>${details.costs}</td>
                                <td>${details.performDept}</td>
                                <td>${details.storageId}</td>
                                <td>${details.user.name}</td>
                                <td><fmt:formatDate value="${details.createDate}" pattern="yyyy-MM-dd"></fmt:formatDate></td>
                            </tr>
                            </c:forEach>
                        </table>
                        <div class="pagination">${page}</div>
                    </div>
                </div>
            </section>
        </div>
    </div>